package cn.tedu;

import cn.tedu.ba03.Student;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Mytest03 {

    @Test
    public void test01(){
        String config="ba03/applicationContext.xml";
        ApplicationContext ac=new ClassPathXmlApplicationContext(config);
        Student myStudent = (Student) ac.getBean("MyStudent02");
        int i = ac.getBeanDefinitionCount();
        System.out.println("创建了"+i+"个对象");
        String[] names = ac.getBeanDefinitionNames();
        for (String name : names) {
            System.out.println(name);
        }
        System.out.println(myStudent);
    }
}
